home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / pmlsrc23.zoo / pmlsrc / makefile.pml < prev    next >
Encoding:
Makefile  |  1994-03-19  |  3.8 KB  |  176 lines

  1. #
  2. #  FILE
  3. #
  4. #    Makefile    build and install the pml library (tos-gcc)
  5. #    
  6. #  USAGE
  7. #    make m=value e=true s=true 
  8. #        where m=value is either
  9. #            m=m68881
  10. #            to support systems with an 68020/68030+68881/68882
  11. #            (the 'TT-version' of the lib)
  12. #
  13. #            lib name: pml020.olb
  14. #        or
  15. #            m=sfp004
  16. #            to support 68000 based systems with a memory mapped
  17. #            68881
  18. #            such as the MEGA ST with Atari's sfp004 board
  19. #            or compatibles like Weide's board
  20. #            or (hopefully) the coprocessor of the MEGA STE
  21. #
  22. #            lib name: pmlsfp.olb
  23. #
  24. #        default (m omitted)
  25. #            make the pml for systems without coprocessor
  26. #
  27. #            lib name: pml.olb
  28. #
  29. #        e=true
  30. #            compiles with error checking code
  31. #            meaningful only in combination with m68020/m68881/sfp004
  32. #
  33. #            lib name: not affected
  34. #
  35. #        s=true
  36. #            sets -D__MSHORT__
  37. #
  38. #            lib name: pml16.olb, pml02016.olb, pmlsfp16.olb
  39. #
  40. #    make checks the following environment variables for the executables
  41. #    if they are defined, the make variables CC,.. need not be defined any more
  42. #
  43. #        CC=c:\gcc.140\exec\cc.ttp
  44. #        LD=c:\gcc.140\exec\cc.ttp
  45. #        AR=c:\gcc.140\exec\ar.ttp
  46. #        AS=c:\gcc.140\exec\as.ttp
  47. #        CC1=c:\gcc.140\exec\cc1.ttp
  48. #        CPP=c:\gcc.140\exec\cpp.ttp
  49. #        PATH=c:\bin,c:\gcc.140\exec,c:\gcc.140\util,d:\,e:\tex,k:\konvekt
  50. #
  51. #    M.Ritzert, ritzert@dfg.dbp.de
  52. #    4.Januar 1992
  53. #    
  54. #  SYNOPSIS
  55. #
  56. #    make funcs    make version of library in local directory
  57. #    make install    install the library (must be root)
  58. #
  59. #  WARNING
  60. #
  61. #    The order of the modules listed in the "LEVEL<n>" macros
  62. #    is significant since these are the orders in which
  63. #    they will be loaded into the library archive.  Although
  64. #    some machines support randomly ordered libraries, ordering
  65. #    them correctly doesn't hurt...
  66.  
  67. .SUFFIXES:
  68. .SUFFIXES: .c .s .o .h .cpp
  69.  
  70.  
  71. DEFINE    := -DIEEE -Datarist 
  72. OPT    := -O2
  73. OFLAGS    := -fomit-frame-pointer -fstrength-reduce 
  74. OUTLIB    := pml.olb
  75.  
  76. CFLAGS    := $(OPT) $(OFLAGS) $(XFLAGS) $(DEFINE) -I.
  77. PFLAGS    := $(DEFINE)
  78.  
  79. # check the command line arguments
  80. #
  81. # the check for 16 bit ints must be performed first to ensure correct 
  82. # library names to be built
  83.  
  84. define run-ar
  85.  $(AR) rs $(OUTLIB) $(OBJ)
  86. endef
  87.  
  88. define    compile_and_touch
  89.     $(CC) $(CFLAGS) -c  $<
  90. endef
  91.  
  92. ifneq (,$(findstring true,$(asm)))
  93. CFLAGS    := $(CFLAGS) $(addprefix  ,-S)
  94. define    compile_and_touch
  95.     $(CC) $(CFLAGS) -c  $<
  96.     touch $@
  97. endef
  98. define run-ar
  99. endef
  100. endif
  101.  
  102. ifneq (,$(findstring true,$(s)))
  103.  CFLAGS    := $(CFLAGS) $(addprefix  , -mshort)
  104.  PFLAGS    := $(PFLAGS) $(addprefix  ,-D__MSHORT__)
  105.  OUTLIB    := $(subst .olb,16.olb, $(OUTLIB))
  106. endif
  107.  
  108. ifneq (,$(findstring 881,$(m)))
  109.  CFLAGS    := $(CFLAGS) $(addprefix  ,-m68020 -m68881 -DNO_INLINE_MATH)
  110.  OUTLIB    := $(subst .olb,020.olb, $(OUTLIB))
  111. endif
  112.  
  113. ifneq (,$(findstring sfp004,$(m)))
  114.  CFLAGS    := $(CFLAGS) $(addprefix  ,-Dsfp004)
  115.  OUTLIB    := $(subst .olb,sfp.olb, $(OUTLIB))
  116. endif
  117.  
  118. LEVEL0    :=    cerr.o
  119.  
  120. LEVEL0a    :=    matherr.o ident.o
  121.  
  122. LEVEL1    :=    sign.o mod.o poly.o dabs.o sqrt.o rint.o
  123.  
  124. LEVEL2    :=    acos.o acosh.o asin.o asinh.o atan2.o atan.o \
  125.         log10.o tan.o \
  126.         tanh.o sinh.o cosh.o atanh.o \
  127.         log.o sin.o cos.o exp.o floor.o pow.o max.o min.o
  128.  
  129. LEVEL3    :=    casin.o cacos.o cmult.o catan.o ccosh.o clog.o \
  130.         crcp.o csinh.o csqrt.o ctan.o ctanh.o cexp.o \
  131.         ccos.o csin.o cdiv.o csubt.o cabs.o
  132.  
  133. LEVEL4    :=    cadd.o
  134.  
  135.  
  136. OBJ    :=    $(LEVEL4) $(LEVEL3) $(LEVEL2) $(LEVEL1) $(LEVEL0a)
  137.  
  138. ifneq (,$(findstring true,$(e)))
  139. CFLAGS    := $(CFLAGS) $(addprefix  ,-DERROR_CHECK)
  140. OBJ    := $(OBJ) $(addprefix  , $(LEVEL0))
  141. endif
  142.  
  143.  
  144. #
  145. #    The default thing to make.
  146. #
  147.  
  148. default:    $(OUTLIB)
  149.         $(run-ar)
  150.  
  151. $(OUTLIB) :    $(OBJ)
  152.  
  153. $(LEVEL0) :    pml.h
  154. $(LEVEL0a) :    pml.h
  155. $(LEVEL1) :    pml.h
  156. $(LEVEL2) :    pml.h
  157. $(LEVEL3) :    pml.h
  158. $(LEVEL4) :    pml.h
  159.  
  160. #
  161. #    Clean up the directory.
  162. #
  163.  
  164. clean:
  165.     rm -f *.o *.BAK *.tmp *.bak nohup.out
  166.  
  167. realclean: clean
  168.     rm -f *.olb report core
  169.  
  170. %.s :: %.cpp
  171.     $(CPP) $(PFLAGS) -P  $< $@
  172.  
  173. # mjr: needed to make .s files from .c files if asm=true
  174. %.o :: %.c
  175.     $(compile_and_touch)
  176.